<template>
	<view>
		<view class="">
			<myitem></myitem>
			<view class="goback" @click="goback">
				 回到上一页
			</view>
			<form @submit="onsubmit">
				<view class="row">
					<input type="text" name="username">
				</view>
				<view class="row">
					<textarea name="content"></textarea>
				</view>
				<view class="row">
					<radio-group name="gender">
						<radio value="男">男</radio>
						<radio value="女">女</radio>
						<radio value="保密" checked>保密</radio>
					</radio-group>
				</view>
				<view class="row">
					<picker :range="options" name="education" :value="selectvalue" @change="pickerchange">
						<view>点击选择学历：{{options[selectvalue]}}</view>
					</picker>
				</view>
				<view class="row">
					<button form-type="submit" type="primary">提交表单</button>
					<button form-type="reset">重置表单</button>
				</view>
			</form>
		</view>
		{{obj}}
		-------------
		<input type="text" v-model="title">
		<view>原标题：{{title}}</view>
		<view>修改后：{{changeTitle}}</view>
		
		<view>{{demo}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:"",
				obj:null,
				options:["高中","大专","本科","研究生"],
				selectvalue:2,
				text:"学院"
			};
		},
		methods:{
			goback(){
				uni.navigateBack()
			},
			onsubmit(e){
				console.log(e)
				this.obj=e.detail.value
				// this.selectvalue=e.detail.value.education
				console.log(this.obj)
			},
			pickerchange(e){
				this.selectvalue=e.detail.value
				console.log(e)
			}
		},
		computed:{
			demo(){
				return this.text+"uniapp"
			},
			changeTitle(){
				return this.title.toUpperCase()
			}
		},
		// mounted(){
		// 	console.log(this.$route)
		// }
		onLoad(e){
			console.log(e)
		}
	}
</script>

<style lang="scss">
input,textarea{
	border: 1px solid #ccc;
	width: 100%;
}
.row{
	padding: 20px 0;
}
</style>
